#!/usr/bin/env node

function Bomb(id){
  this.message = id+"Bomb";
}

Bomb.prototype.explode = function(){
  console.log(this.message);
}

var bomb = new Bomb();

//var timeId = setTimeout(bomb.explode.bind(bomb),2000);

//clearTimeout(timeId);
var timeID;
Bomb.prototype.start = function(){
  timeID = setTimeout(bomb.explode.bind(bomb),3000);
}

Bomb.prototype.clear = function(){
  clearTimeout(timeID);
}

var b1 = new Bomb(1);
var b2 = new Bomb(2);

b1.start();
b2.start();

setTimeout(b2.clear.bind(b2),1000);
